{% extends "photologue/root.html" %}

{% load photologue_tags %}
{% load tagging_tags %}

{% block title %}{{ object.title }}{% endblock %}

{% block body_id %}photo_detail{% endblock %}

{% block content %}

<div id="title">
    <h1>{{ object.title }}</h1>
</div>

<div class="gallery-photo">
    <a href="{{ object.image.url }}"><img src="{{ object.display.url }}" alt="{{ object.title }}"/></a>
    <h2 class="photog">{{ object.photographer|default_if_none:"" }}</h2>
</div>
<div class="desc">
    {{ object.caption|linebreaks }}
    <p class="tags">
        {% tags_for_object object as tags %}
        {% for t in tags %}
            {% if forloop.first %}Tags:{% endif %}
            <a href="{% url photo_tags_detail t.name|slugify %}">{{t}}</a> 
        {% endfor %}
    </p>
</div>
<div class="gallery">
{% if object.public_galleries %}
<ol>
{% for gallery in object.public_galleries %}
    <li>
    {%next_in_gallery object gallery%}
    {%previous_in_gallery object gallery%} 
    <h2><a href="{{ gallery.get_absolute_url }}">{{ gallery.title }}</a> gallery</h2> 
    </li>
{% endfor %}
</ol>
{% endif %}
</div>

{% endblock %}
